-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Mark std::fmt::from_fn
as #[must_use]
#136502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I think this is fine but it should get an ack from the api team r? libs-api
This should be simple enough to figure out now, maybe something along the lines of "result does nothing unless used in a formatter". |
"returns a type implementing Debug and Display, which do not have any effects unless they are used". |
I think burntsushi has been taking a break from reviews r? libs-api |
Maybe "in a formatting operation"? |
I like that one.. |
The need to avoid "formatter" or "formatting operation" becomes obvious considering you could just call |
0474182
to
6b016d7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
@bors r+ rollup |
While working on #135494 I managed to shoot my own foot a few times by forgetting to actually use the result of
fmt::from_fn
, so I think a#[must_use]
could be appropriate!Didn't have a good message to put in the attr so left it blank, still unstable so we can come back to it I guess?
cc #117729 (and a huge +1 for getting it stabilized, it's very useful IMHO)